package tc.de.krawallmann.settings;

/**
 * The class Setting.
 * 
 * @param <T>
 *            the generic type
 * @author KrawallMann
 * @version 1.0
 */
public class Setting<T> {

	/** The setting's name. */
	private String name;

	/** The value. */
	private T value;

	/**
	 * Instantiates a new setting.
	 */
	public Setting() {
		super();
	}

	/**
	 * Instantiates a new setting.
	 * 
	 * @param name
	 *            the setting's name
	 * @param value
	 *            the value
	 */
	public Setting(final String name, final T value) {
		super();
		this.name = name;
		this.value = value;
	}

	/**
	 * Gets the setting's name.
	 * 
	 * @return the setting's name
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * Gets the setting's type.
	 * 
	 * @return the setting's type
	 */
	public Class<?> getType() {
		return value.getClass();
	}

	/**
	 * Gets the setting's value.
	 * 
	 * @return the setting's value
	 */
	public T getValue() {
		return this.value;
	}

	/**
	 * Sets the setting's name.
	 * 
	 * @param name
	 *            the setting's new name
	 */
	public void setName(final String name) {
		this.name = name;
	}

	/**
	 * Sets the setting's value.
	 * 
	 * @param value
	 *            the setting's new value
	 */
	public void setValue(final T value) {
		this.value = value;
	}

}
